Color Class
A Color is an intrinsic data type that consists of three bytes that define the color. A color can be set using the RGB, HSV, or CMY models or the &c literal.
Each set of properties is used with the appropriate function to specify a color. The values of any of the nine properties can then be read. The default value of a Color is &c000000 (white).
Notes
Colors are often used to assign colors to properties of type Color. Use the RGB, HSV, or CMY functions to assign a color to an object or use the format:
where RR is the RGB value of Red in hexadecimal, GG is the value Green in hexadecimal, and BB is the value of Blue in hexadecimal. You can choose the color that you want to assign to a property by clicking on the existing color in the Properties pane to open the Color picker. Choose the color via the Color picker and REALbasic will figure out the hexadecimal values that represent that color.
You can use the VarType function to determine whether a property or a variable is a Color. If it is, VarType returns 16.
Examples
The following example uses the RGB model to set the forecolor property of a Canvas control and draw a square using the current forecolor. The code is placed in the Canvas control's Paint event.
The following example assigns a color directly using the RGB color model. The RGB values must be specified in hexadecimal:
The following example uses the CMY model to set the fillcolor of a Rectangle control, r.
The following example inverts the fillcolor:
See Also
CMY, DarkTingeColor, FillColor, FrameColor, HighlightColor, HSV, LightBevelColor, LightTingeColor, RGB, SelectColor, TextColor, Variant, VarType functions; &c literal; Dim statement.